<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

        <title>登录</title>
        <meta name="keywords" content="">
        <meta name="description" content="">
        <link href="public/css/bootstrap.min.css" rel="stylesheet">
        <link href="public/css/font-awesome.css?v=4.4.0" rel="stylesheet">
        <link href="public/css/animate.css" rel="stylesheet">
        <link href="public/css/style.css" rel="stylesheet">
        <link href="public/css/login.css" rel="stylesheet">
        <script src="public/js/jquery.min.js?v=2.1.4"></script>
        <script src="public/js/plugins/layer/layer.min.js"></script>
        <!--[if lt IE 9]>
        <meta http-equiv="refresh" content="0;ie.html" />
        <![endif]-->
        <script>
            if (window.top !== window.self) {
                window.top.location = window.location;
            }
        </script>

    </head>

    <body class="signin">
        <div class="signinpanel">
            <div class="row">
                <div class="col-sm-12">
                    <div class="form1">
                        <h4 class="no-margins">登录：</h4>
                        <p class="m-t-md">登录到优惠券管理平台</p>
                        <input type="text" class="form-control uname" id="username" placeholder="用户名" />
                        <input type="password" class="form-control pword m-b" id="password" placeholder="密码" />
                        <!--                    <a href="">忘记密码了？</a>-->
                        <button class="btn btn-success btn-block" id="login">登录</button>
                    </div>
                </div>
            </div>
            <div class="signup-footer">
                <div class="pull-left">
                    <!--                &copy; hAdmin-->
                </div>
            </div>
        </div>
        <script>
            function login() {
                var username = $("#username").val();
                var password = $("#password").val();
                if (username == "") {
                    layer.msg("用户名不为空", {
                        time: 2000, //20s后自动关闭
                        btn: ['OK']
                    });
                    return;
                }
                if (password == "") {
                    layer.msg("密码不为空", {
                        time: 2000, //20s后自动关闭
                        btn: ['OK']
                    });
                    return;
                }
                if (username != "admin" || password != "admin") {
                    layer.msg("账号或密码错误", {
                        time: 2000, //20s后自动关闭
                        btn: ['OK']
                    });

                } else {
                    window.location = "index.html";
                }
                return;
            }
            $(document).keyup(function (event) {
                if (event.keyCode == 13) {
                    login();
                }
            });
            $("#login").click(function () {
                login();
            });
        </script>
    </body>

</html>
